package com.gem.entity;

import lombok.Data;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * Author: Xhy
 * CreateTime: 2022-09-17 23:50
 */
// 房间名、房间人数（当前人数/最大人数)、房主、房间状态(等待、已开始)
@Data
public class Room {

    private String roomId;

    private String roomName;

    private AtomicInteger maxPeople = new AtomicInteger(4);

    private AtomicInteger curPeople = new AtomicInteger(0);

    private Date createTime;

    // 房主id
    private String roomOwnerId;

    // 房主名称
    private String roomOwnerName;

    private Boolean state; // 状态

    private Set<User> users;

    // 校验房主
    public boolean verifyRoomOwner(String userId){
        return roomOwnerId.equals(userId);
    }

    public void addRobot(Integer robotLevel) {
    }
}
